package com.smart.eleven.annotate;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.sql.SQLException;

/**
 * service
 *
 * @author junrui.wang
 * @create 2019/8/1
 */
@Service
@Transactional(
        propagation = Propagation.REQUIRES_NEW,
        isolation = Isolation.READ_COMMITTED,
        readOnly = false,
        timeout = -1,
        rollbackFor = {SQLException.class},
        rollbackForClassName = {"Exception"},
        noRollbackFor = {},
        noRollbackForClassName = {}
)
public class BBTForumLogic{
    @Resource
    private BBTForumDao dao;

    public void addBBT(BBTForum forum){
        dao.addBBT(forum);
    }

    public void updateBBT(String id, BBTForum bbtForum){
        dao.updateBBT(id, bbtForum);
    }

    public BBTForum getBBT(String id){
        return dao.getBBT(id);
    }

    public boolean deleteBBT(String id) {
        return dao.deleteBBT(id);
    }
}
